﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class StatementRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlMonth;
        protected DropDownList ddlOwnerIDOper;
        protected DropDownList ddlYear;
        protected HtmlForm F15610;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage imgOwnerID;
        protected Label lblOwnerID;
        protected Label lblQuery;
        protected Label lblStatementDate;
        protected HtmlLink mycss;
        protected TextBox txtOwnerID;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("StatementRptList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("StatementRptList.aspx?action={0}", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        private void LoadData()
        {
            this.ddlYear.SelectedValue = DateTime.Now.Year.ToString() + "年";
            this.ddlMonth.SelectedValue = DateTime.Now.Month.ToString() + "月";
            base.InitQueryDDL(this.ddlOwnerIDOper, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadData();
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string StatementDate
        {
            get
            {
                return base.GetParamsString(this.ddlYear.SelectedValue + this.ddlMonth.SelectedValue, "Same As");
            }
        }
    }
}

